<?php
	$password = $_GET['accpass'];
	$strength = 0;
    $patterns = array('#[a-z]#','#[A-Z]#','#[0-9]#','/[¬!"£$%^&*()`{}\[\]:@~;\'#<>?,.\/\\-=_+\|]/');
    foreach($patterns as $pattern)
    {
        if(preg_match($pattern,$password,$matches))
        {
            $strength++;
        }
    }
	
	if( $strength == 1 ) {
		echo "<img alt=\"1\" src=\"../img/pass1.gif\" />";
	}elseif($strength == 2) {
		echo "<img alt=\"2\" src=\"../img/pass2.gif\" />";
	}elseif($strength == 3) {
		echo "<img alt=\"3\" src=\"../img/pass3.gif\" />";
	}elseif($strength == 4) {
		echo "<img alt=\"4\" src=\"../img/pass4.gif\" />";
	}else{
		echo "";
	}
    
    // 1 - weak
    // 2 - not weak
    // 3 - acceptable
    // 4 - strong 
?>
